package web.eshop.order;

import org.apache.wicket.Component;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.wicketstuff.annotation.mount.MountPath;
import org.wicketstuff.annotation.strategy.MountIndexedParam;
import web.eshop.ShopBasePage;
import web.eshop.panels.CategoryTreePanel;

@MountPath(path = "orderPage")
@MountIndexedParam
public final class OrderPage extends ShopBasePage {

    Panel currentPanel;
    CategoryTreePanel categoryTreePanel;

    public OrderPage() {
        super();
        currentPanel = new OrderPanel1("content", this);
        add(currentPanel);
    }

    @Override
    protected Component newLeftPanel(String id) {
        return categoryTreePanel = new CategoryTreePanel(id);
    }

    @Override
    protected Component newRightPanel(String id) {
        return new EmptyPanel(id);
    }

    public OrderPage(PageParameters params) {
        this();
    }

    @Override
    public IModel getPageTitle() {
        return new Model("OrderPage");
    }

    @Override
    public IModel getDescription() {
        return new Model("OrderPage");
    }

    @Override
    public IModel getKeywords() {
        return new Model("OrderPage");
    }

    public void replacePanel(Panel panel) {
        currentPanel.replaceWith(panel);
        currentPanel = panel;
    }


}

